package com.wqz.dao;

import com.wqz.pojo.Commodity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

public interface CommodityDao {

    /**
     * 查找所有的商品
     * @return
     * @throws Exception
     */
    public List<Commodity> findCommodityList() throws Exception;

    /**
     * 删除一个商品
     * @param id
     * @return
     * @throws Exception
     */
    public int deleteCommodity(Integer id) throws Exception;

    /**
     * 添加一件商品
     * @param commodity
     * @return
     * @throws Exception
     */
    public int addCommodity(@Param("commodity") Commodity commodity) throws Exception;

    public Commodity findCommodityById(@Param("id") Integer id) throws Exception;

    /**
     * 按照关键字筛选类型相同的
     * @param keyWord
     * @return
     * @throws Exception
     */
    public List<Commodity> findSomeCommodity(@Param("keyWord") String keyWord) throws Exception;

}
